package com.chen.positioning.config.pay;


import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	//public static String app_id = "2018111262085000";
	public static String app_id ="2018111262148099";


	
	// 商户私钥，您的PKCS8格式RSA2私钥
    //public static String merchant_private_key="MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDYAU7vHY5baiSZFziJg7WUoJMBYAqwC/b2OBnIWzfPboOrsC44tHaWkVgXbcJKvw4RQlnmtUQVn9dmgwoy6rZdvscWxLOykG5p63tgiriuOIyJ0p5rG8kkOqRCfRi65MCzG+IWeVJPO/6K4OaYpLjSaUkzyGMXzeR76vkgwBYvRDvZ7RE0JXHQvJXGSzRFEi5SB/Uy0kb/Q/pgM+gEf8biZIH/NwVeKU7gXb2Fh+cZFELkGuNP+7wb5XPyMN6DKmYQ+oShrdOX7KIZJLnTQyrB6fwCjcBE3nnYzRIxDGd4IOEvyaBMwv9GObziAhmSz7i4j/OLe60AN+eLASxxo3xpAgMBAAECggEAbL4T39sQTMMd05hWFRyicEV6XGneV4xecswBZtVNPndTgD58tn1baieXoovWEU0nptaxbaz5rq0+glQb8VAqKP2fOr4h/RYrD9XF0e9kVAkR71yB9kgRtdRz1yklJwl8XW7/HfNL1anNVlssm9HpXbw1ZwVNpbE4go3jh3JMeNRDPAVKa3VzOK+f1dPt3ChQIFJONYGH7TVX8fxabWd5dGHppDAienN7MMAXybEW75JUkA6vE8wrKW+i61ITdShl9mudjCPl4if8AT0wjYvOl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ru5KBIKItzXnxUgzn5DQ1KnqZ2qLnRKs2IRrlVhjnJwhtsQf0jUdI86z50baaSNGsctJ9YieOwq2NQKBgD1b8aRCRMquhb6Rrrlddqc0d3ZCmwn/igcGuSLkx6DVxrIbjHF+/093oY8hL/rS/dgJC+kGjjOvCtf5uSWmGnTV6Uls3VGD3696ssYU27y3ryvC3pvnLI1pU4l7qYKCXqDmUrDc+r2PiKTgQYIXNcrav3D9kK1gwR14zYxAer2RAoGBAOEGozGgt9QNmm+OmWQ6JIQrQt/tZuuXj58M/2S4V5PzSYrdkfrM3iLYsRY81W7AqR8Kl6j/ID316npbJ15dJ/pdPelYorHTTMm/BKwPC+7wrukH1Xd9V8M2TiajORuF+dSk9wpkrH+j2LDIwRf9Fd5VbxbdcTGQcOmUgiGy4oW4";



	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    //public static String alipay_public_key="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApXlrjEXTfE0J+3lj8BC15fgTAULrW13no0KxK+QnVDz1s+5UPI0AC8R840A9QvX2e8Qenh64+BNSrPym6m+9f1BXJNXsqMVCyaVwePVsNT2MnYtYG7iWa8Jt3GImg17Xxuimw8kzIrRQPLwUHdomnVHZ/31P0wtcYYpoauEzIaFnoSSfVPCWKXTf8DGDQIidaVDk9pFrlcxw4PrQ4S9XjYmnTKR9cT9haYv5raj+ggaJRC1O1EzqvLFVKhLLpFqwbavKekye7UmdIt+AEljRujqaqPUfKhPpHx+O37NldqemNyvHvOT3bF86HYZDwnT+gALv70p/s/e+PzKaRbl8ywIDAQAB";

    public static String alipay_public_key="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlOZ8z12/f4KERzoFtfMXvQpWw02rEZ0LZc0EMBZBb4U5JMm632FL5Y6tkjnypCRm+8+T8LLhKgZoXKNSMEY57W5qKviBSfhE8rPy2EEcjf5yJsSVpX0vyPfuqyDHAJ96EQT8h/edF1olMhUwoD+pmofrPmSmR7SX0iqF97I+ZO94MYbiXAeixenc153WIFOXAEjaHEDyX0btAyINH7QiK+mhQ41d+8v1qT2F2lDmjZuZCxGUmLQzDbN2llBxKrs6UmiTEwy55BPUy73uDeAwbVBoazOpQ8RQvE+Q+EIgkR11zcj14F+uZwM/1VPwHeiiOFb2tTMDpRhdNVJ7mE92zwIDAQAB";



	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url ="http://148.70.216.226:8080/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url ="http://148.70.216.226:8080/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";

	// 签名方式
	public static String sign_type ="RSA2";
	
	// 字符编码格式
	public static String charset ="utf-8";
	
	// 支付宝网关
	public static String gatewayUrl ="https://openapi.alipay.com/gateway.do";
	
	// 支付宝网关
	public static String log_path ="https://openapi.alipay.com/gateway.do";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

